
{% extends "admin/common/layout.html" %}
{% block active %}account{% endblock %}
{% block body %}
<h2>系统账户管理</h2>
{% include "admin/common/flash.html" %}
{% include "admin/account/nav.html" %}
<form class="form-horizontal" role="form" method="POST">
    <div class="form-group">
        <label for="name" class="col-sm-2 control-label">用户名</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="name" name="name" placeholder="请输入用户名" value="{{ account.name }}" {% if req.id %}readonly{% endif %}>
        </div>
    </div>

    <div class="form-group">
        <label for="nick_name" class="col-sm-2 control-label">昵称</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="nick_name" name="nick_name" placeholder="请输入昵称" value="{{ account.nick_name }}">
        </div>
    </div>

    <div class="form-group">
        <label for="mobile" class="col-sm-2 control-label">手机号</label>
        <div class="col-sm-10">
            <input type="text" class="form-control" id="mobile" name="mobile" placeholder="请输入手机号" value="{{ account.mobile }}">
        </div>
    </div>

    <div class="form-group">
        <label for="passwd" class="col-sm-2 control-label">密码</label>
        <div class="col-sm-10">
            <input type="password" class="form-control" id="passwd" name="passwd" placeholder="请输入密码" value="">
        </div>
    </div>

    <div class="form-group">
        <label for="passwd" class="col-sm-2 control-label">密码确认</label>
        <div class="col-sm-10">
            <input type="password" class="form-control" id="passwd_confirm" name="passwd_confirm" placeholder="请再次输入密码" value="">
        </div>
    </div>

    <div class="form-group">
        <label for="role_id" class="col-sm-2 control-label">角色</label>
        <div class="col-sm-10">
            {% if req.id %}
            <input type="text" class="form-control" id="text" placeholder="" value="{{ roles[account.role_id].name }}" readonly="">
            <input type="hidden" name="role_id" value="{{ account.role_id }}">
            {% else %}
            <select name="role_id" class="form-control">
                {% for k, item in roles.items() %}
                <option value="{{ item.id }}" {% if account.role_id and account.role_id|int == item.id %}selected=''{% endif %}>{{ item.name }}</option>
                {% endfor %}
            </select>
            {% endif %}
        </div>
    </div>


    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10" role="toolbar" aria-label="...">
            <div class="btn-group" role="group">
                <button type="submit" class="btn btn-default">保存</button>
            </div>
        </div>
    </div>
</form>
{% endblock %}
